/*
 * VFS Error codes
 * Last updated: 15-Nov-2012
 */
//New  (if the argument is not specified)
#define ERR_VFS_CREATE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_CREATE_01 "DATA_FILE_ALREADY_EXISTS"
#define ERR_VFS_CREATE_02 "CANNOT_CREATE_DATAFILE"
#define ERR_VFS_CREATE_03 "INVALID_CHARACTER_IN_NAME"// The slash (/) character is not allowed
#define ERR_VFS_CREATE_04 "INVALID_SIZE"// Valid range for size is 1 to 1024 (inclusive)
#define ERR_VFS_CREATE_05 "VFS_LABEL_TOO_LARGE"//New   (If label name exceeds 30 characters)


#define ERR_VFS_MOUNT_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_MOUNT_01 "DATA_FILE_NOT_FOUND"
#define ERR_VFS_MOUNT_02 "CANNOT_READ_FROM_FILE"
#define ERR_VFS_MOUNT_03 "VFS_ALREADY_MOUNTED"//New


#define ERR_VFS_UNMOUNT_00 "VFS_INSUFFICIENT_ARGUMENTS"// Use when fopen fails
#define ERR_VFS_UNMOUNT_01 "DATA_FILE_NOT_FOUND"// Use when fwrite fails
#define ERR_VFS_UNMOUNT_02 "CANNOT_WRITE_TO_FILE"//New
#define ERR_VFS_UNMOUNT_03 "VFS_NOT_MOUNTED"


#define ERR_VFS_MAKEDIR_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_MAKEDIR_01 "FILESYSTEM_FULL"//changed to FILESYSTEM_FULL from UNABLE_TO_CREATE_NEWDIR
#define ERR_VFS_MAKEDIR_02 "INVALID_CHARACTER_IN_DIRNAME"
#define ERR_VFS_MAKEDIR_03 "DIRECTORY_ALREADY_EXISTS"
#define ERR_VFS_MAKEDIR_05 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_DELETEDIR_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_DELETEDIR_01 "CANNOT_FIND_SPECIFIED_DIR"
#define ERR_VFS_DELETEDIR_02 "DIRECTORY_IS_NOT_EMPTY"
#define ERR_VFS_DELETEDIR_04 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_MOVEDIR_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_MOVEDIR_01 "CANNOT_FIND_SPECIFIED_SOURCEDIR"
#define ERR_VFS_MOVEDIR_02 "CANNOT_FIND_SPECIFIED_DESTINATIONDIR"//(if specified dir is not there, it is not created in this case unlike in add dir)
#define ERR_VFS_MOVEDIR_04 "SOURCE_CANNOT_BE_FILE"//New
#define ERR_VFS_MOVEDIR_05 "DESTINATION_ALREADY_HAVE_SOURCE_DIR"
#define ERR_VFS_MOVEDIR_06 "CANNOT_MOVE_PARENT_TO_CHILD_DIR"//New
#define ERR_VFS_MOVEDIR_07 "DESTINATION_CANNOT_BE_FILE"//New
#define ERR_VFS_MOVEDIR_08 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_LISTDIR_00 "VFS_INSUFFICIENT_ARGUMENTS"//New
#define ERR_VFS_LISTDIR_01 "CANNOT_FIND_SPECIFIED_PATH_OR_DIR"
#define ERR_VFS_LISTDIR_02 "INVALID_FLAG"
#define ERR_VFS_LISTDIR_03 "VFS_NOT_MOUNTED"
#define ERR_VFS_LISTDIR_04 "CANNOT_CREATE_OUTPUTFILE"


#define ERR_VFS_ADDFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_ADDFILE_02 "INVALID_CHARACTER_IN_FILENAME"
#define ERR_VFS_ADDFILE_03 "FILE_ALREADY_EXISTS"
#define ERR_VFS_ADDFILE_04 "FILE_SYSTEM_FULL"
#define ERR_VFS_ADDFILE_05 "CANNOT_WRITE_TO_DATAFILE"//New
#define ERR_VFS_ADDFILE_06 "FILE_TOO_LARGE"//New : (if data exceeds block size)
#define ERR_VFS_ADDFILE_07 "VFS_NOT_MOUNTED"//New
#define ERR_VFS_ADDFILE_08 "ADDFILE_SOURCE_NOT_FOUND"
#define ERR_VFS_ADDFILE_09 "DIRECTORY_DOES_NOT_EXIST"


#define ERR_VFS_LISTFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_LISTFILE_01 "SOURCE_FILE_PATH_NOT_FOUND"
#define ERR_VFS_LISTFILE_02 "NOT_A_TEXT_FILE"
#define ERR_VFS_LISTFILE_03 "CANNOT_CREATE_OUTPUTFILE"//New
#define ERR_VFS_LISTFILE_04 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_UPDATEFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_UPDATEFILE_01 "INTERNAL_FILE_NOT_FOUND"
#define ERR_VFS_UPDATEFILE_02 "EXTERNAL_FILE_NOT_FOUND"
#define ERR_VFS_UPDATEFILE_03 "EXTERNAL_FILE_TOO_LARGE"//New
#define ERR_VFS_UPDATEFILE_04 "VFS_NOT_MOUNTED"//New
#define ERR_VFS_UPDATEFILE_05 "INCORRECT_FILE_FORMAT";
#define ERR_VFS_UPDATEFILE_06 "UPDATEFILE_CANNOT_WRITE_TO_DATAFILE\n");


#define ERR_VFS_EXPORTFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_EXPORTFILE_01 "CANNOT_FIND_SOURCEFILE"
#define ERR_VFS_EXPORTFILE_02 "CANNOT_CREATE_OUTPUTFILE"
#define ERR_VFS_EXPORTFILE_03 "CANNOT_EXPORT_DIR"
#define ERR_VFS_EXPORTFILE_04 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_REMOVEFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_REMOVEFILE_01 "CANNOT_FIND_SPECIFIED_FILE"// Use this error even when the given argument is a directory and not a file
#define ERR_VFS_REMOVEFILE_02 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_MOVEFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_MOVEFILE_01 "CANNOT_FIND_SOURCEFILE"
#define ERR_VFS_MOVEFILE_02 "CANNOT_FIND_DESTINATION_PATH"
#define ERR_VFS_MOVEFILE_06 "VFS_NOT_MOUNTED"//New


#define ERR_VFS_COPYFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_COPYFILE_01 "CANNOT_FIND_SOURCEFILE"
#define ERR_VFS_COPYFILE_02 "CANNOT_FIND_DESTINATIONPATH"
#define ERR_VFS_COPYFILE_03 "CANNOT_COPY_DIR_TO_FILE"
#define ERR_VFS_COPYFILE_04 "FILE_SYSTEM_FULL"
#define ERR_VFS_COPYFILE_05 "VFS_NOT_MOUNTED"


#define ERR_VFS_SEARCHFILE_00 "VFS_INSUFFICIENT_ARGUMENTS"
#define ERR_VFS_SEARCHFILE_02 "VFS_NOT_MOUNTED"//New

//--------------------------------------------used in the program----------------------------------------//
//create_vfs
#define CREATEVFS_DATA_FILE_ALREADY_EXISTS 1
#define CREATEVFS_CANNOT_CREATE_DATAFILE 2
#define CREATEVFS_INVALID_CHARACTER_IN_NAME 3
#define CREATEVFS_INVALID_SIZE 4
#define CREATEVFS_VFS_LABEL_TOO_LARGE 5
#define CREATEVFS_NOT_ENOUGH_MEMORY 6   //built for extra functionality


//mount_vfs
#define MOUNTVFS_DATA_FILE_NOT_FOUND 1
#define MOUNTVFS_CANNOT_READ_FROM_FILE 2
#define MOUNTVFS_VFS_ALREADY_MOUNTED 3


//unmount_vfs
#define UNMOUNTVFS_DATA_FILE_NOT_FOUND 1
#define UNMOUNTVFS_CANNOT_WRITE_TO_FILE 2
#define UNMOUNTVFS_VFS_NOT_MOUNTED 3


//makedir
#define MAKEDIR_FILESYSTEM_FULL 1
#define MAKEDIR_INVALID_CHARACTER_IN_DIRNAME 2
#define MAKEDIR_DIRECTORY_ALREADY_EXISTS 3
#define MAKEDIR_VFS_NOT_MOUNTED 4


//deletedir
#define DELETEDIR_CANNOT_FIND_SPECIFIED_DIR 1
#define DELETEDIR_DIRECTORY_IS_NOT_EMPTY 2
#define DELETEDIR_VFS_NOT_MOUNTED 4


//movedir
#define MOVEDIR_CANNOT_FIND_SPECIFIED_SOURCEDIR 1
#define MOVEDIR_CANNOT_FIND_SPECIFIED_DESTINATIONDIR 2
#define MOVEDIR_SOURCE_CANNOT_BE_FILE 4
#define MOVEDIR_DESTINATION_ALREADY_HAVE_SOURCE_DIR 5
#define MOVEDIR_CANNOT_MOVE_PARENT_TO_CHILD_DIR 6
#define MOVEDIR_DESTINATION_CANNOT_BE_FILE 7
#define MOVEDIR_VFS_NOT_MOUNTED 8


//listdir
#define LISTDIR_CANNOT_FIND_SPECIFIED_PATH_OR_DIR 1
#define LISTDIR_INVALID_FLAG 2
#define LISTDIR_VFS_NOT_MOUNTED 3
#define LISTDIR_CANNOT_CREATE_OUTPUTFILE 4


//---------------addfile---------------
#define ADDFILE_FILE_VFS_INSUFFICIENT_ARGUMENTS 0
#define ADDFILE_INVALID_CHARACTER_IN_FILENAME 2//New : (if data exceeds block size)
#define ADDFILE_FILE_ALREADY_EXISTS 3
#define ADDFILE_FILE_SYSTEM_FULL 4
#define ADDFILE_CANNOT_WRITE_TO_DATAFILE 5//New
#define ADDFILE_FILE_TOO_LARGE 6//New
#define ADDFILE_FILE_VFS_NOT_MOUNTED 7
#define ADDFILE_SOURCE_NOT_FOUND 5   //modified for submission
#define ADDFILE_DIRECTORY_DOES_NOT_EXIST 5 //modified for submission

//--------------list file-------------
#define LISTFILE_VFS_INSUFFICIENT_ARGUMENTS 0
#define LISTFILE_SOURCE_FILE_PATH_NOT_FOUND 1
#define LISTFILE_NOT_A_TEXT_FILE 2
#define LISTFILE_CANNOT_CREATE_OUTPUTFILE 3
#define LISTFILE_VFS_NOT_MOUNTED 4


//---------------update file--------------
#define UPDATEFILE_VFS_INSUFFICIENT_ARGUMENTS 0
#define UPDATEFILE_INTERNAL_FILE_NOT_FOUND 1
#define UPDATEFILE_EXTERNAL_FILE_NOT_FOUND 2
#define UPDATEFILE_EXTERNAL_FILE_TOO_LARGE 3
#define UPDATEFILE_VFS_NOT_MOUNTED 4
#define UPDATEFILE_INCORRECT_FILE_FORMAT 5   //not used anywhere
#define UPDATEFILE_CANNOT_WRITE_TO_DATAFILE 4 //6*modified for submission


//----------------exportfile---------------
#define EXPORTFILE_VFS_INSUFFICIENT_ARGUMENTS 0
#define EXPORTFILE_CANNOT_FIND_SOURCEFILE 1
#define EXPORTFILE_CANNOT_CREATE_OUTPUTFILE 2
#define EXPORTFILE_CANNOT_EXPORT_DIR 3
#define EXPORTFILE_VFS_NOT_MOUNTED 4


//---------------remove file----------
//#define REMOVEFILE_VFS_INSUFFICIENT_ARGUMENTS 0
#define REMOVEFILE_CANNOT_FIND_SPECIFIED_FILE 1
#define REMOVEFILE_VFS_NOT_MOUNTED 2


//----------------move file------------
#define MOVEFILE_CANNOT_FIND_SOURCEFILE 1
#define MOVEFILE_CANNOT_FIND_DESTINATION_PATH 2
#define MOVEFILE_VFS_NOT_MOUNTED 6 //New


//------------copy file-----------
#define COPYFILE_CANNOT_FIND_SOURCEFILE 1
#define COPYFILE_CANNOT_FIND_DESTINATIONPATH 2
#define COPYFILE_CANNOT_COPY_DIR_TO_FILE 3
#define COPYFILE_FILE_SYSTEM_FULL 4
#define COPYFILE_VFS_NOT_MOUNTED 5


//---------------search file-----------
#define SEARCHFILE_VFS_NOT_MOUNTED 2
#define SEARCHFILE_CANNOT_FIND_SPECIFIED_OUTPUTFILE 1

